package com.jamlu.framework.ui.status;

import android.support.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Created by DMing at 2018/2/23 0023
 */

public interface IStatus {

    int LOADING = 0;
    int SUCCESS = 1;
    int NOTHING = 2;
    int ERROR_NETWORK = -1;
    int NO_NETWORK = -2;
    int ERROR_RESPOND = -3;
    @IntDef({LOADING, SUCCESS, NOTHING,ERROR_NETWORK,NO_NETWORK,ERROR_RESPOND})
    @Retention(RetentionPolicy.SOURCE)
    @interface Status {
    }

    /**
     *
     * @param status 状态
     * @param obj 可选传入参数，可能为空
     */
    void switchStatus(@Status int status,Object... obj);

    /**
     * 为了提高效率，手动加快释放
     */
    void releaseRef();
}
